package com.frogs.ucenter.dao.ibatis;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.stereotype.Repository;

import com.frogs.framework.base.dao.ibatis.BaseDaoIbatis;
import com.frogs.ucenter.dao.CommonPhotoDao;
import com.frogs.ucenter.entity.CommonPhoto;
import com.ibatis.sqlmap.client.SqlMapClient;

@Repository("commonPhotoDao")
public class CommonPhotoDaoImpl extends BaseDaoIbatis<CommonPhoto> implements CommonPhotoDao {

	public CommonPhotoDaoImpl() {
		super();
		setNameSpace("common_photo");
	}

	@Required
	@Autowired
	public void setSqlMapClientAutowired(SqlMapClient sqlMapClient) {
		super.setSqlMapClient(sqlMapClient);
	}

	@Override
	public List<String> listPathsByResource(String refResource, int resourceId) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("refResource", refResource);
		params.put("resourceId", resourceId);
		return getSqlMapClientTemplate().queryForList(getNameSpace() + ".listPathsByResource", params);
	}

}